package cn.flying.cloud.flow.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;

import cn.flying.cloud.flow.bo.FwProcInfoBo;

/**
 * 流程定义信息表
 *
 * @author admin
 * @since 2025-09-24 22:32:54
 */
@TableName("fw_proc_info")
public class FwProcInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 流程定义ID
     */
    @TableField("proc_def_id")
    private String procDefId;

    /**
     * 流程定义key
     */
    @TableField("proc_def_key")
    private String procDefKey;

    /**
     * 流程定义名称
     */
    @TableField("proc_def_name")
    private String procDefName;

    /**
     * 流程定义描述
     */
    @TableField("proc_def_desc")
    private String procDefDesc;

    /**
     * 类别
     */
    @TableField("category")
    private String category;

    /**
     * 版本号
     */
    @TableField("version")
    private String version;

    /**
     * 资源文件名
     */
    @TableField("resource")
    private String resource;

    /**
     * 挂起状态
     */
    @TableField("suspended")
    private String suspended;

    /**
     * 流程图
     */
    @TableField("diagram")
    private String diagram;

    /**
     * 流程部署ID
     */
    @TableField("deploy_id")
    private String deployId;

    /**
     * 部署时间
     */
    @TableField("deploy_time")
    private LocalDateTime deployTime;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 创建人
     */
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedTime;

    /**
     * 租户号
     */
    @TableField("tenant_id")
    private String tenantId;

    /**
     * 乐观锁
     */
    @TableField(value = "revision", fill = FieldFill.INSERT)
    @Version
    private Long revision;

    /**
     * 删除标识
     */
    @TableField(value = "deleted", fill = FieldFill.INSERT)
    @TableLogic
    private String deleted;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getProcDefId() {
        return procDefId;
    }

    public void setProcDefId(String procDefId) {
        this.procDefId = procDefId;
    }

    public String getProcDefKey() {
        return procDefKey;
    }

    public void setProcDefKey(String procDefKey) {
        this.procDefKey = procDefKey;
    }

    public String getProcDefName() {
        return procDefName;
    }

    public void setProcDefName(String procDefName) {
        this.procDefName = procDefName;
    }

    public String getProcDefDesc() {
        return procDefDesc;
    }

    public void setProcDefDesc(String procDefDesc) {
        this.procDefDesc = procDefDesc;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getResource() {
        return resource;
    }

    public void setResource(String resource) {
        this.resource = resource;
    }

    public String getSuspended() {
        return suspended;
    }

    public void setSuspended(String suspended) {
        this.suspended = suspended;
    }

    public String getDiagram() {
        return diagram;
    }

    public void setDiagram(String diagram) {
        this.diagram = diagram;
    }

    public String getDeployId() {
        return deployId;
    }

    public void setDeployId(String deployId) {
        this.deployId = deployId;
    }

    public LocalDateTime getDeployTime() {
        return deployTime;
    }

    public void setDeployTime(LocalDateTime deployTime) {
        this.deployTime = deployTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public LocalDateTime getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(LocalDateTime updatedTime) {
        this.updatedTime = updatedTime;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public Long getRevision() {
        return revision;
    }

    public void setRevision(Long revision) {
        this.revision = revision;
    }

    public String getDeleted() {
        return deleted;
    }

    public void setDeleted(String deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return "FwProcInfo{" +
                "id = " + id +
                ", procDefId = " + procDefId +
                ", procDefKey = " + procDefKey +
                ", procDefName = " + procDefName +
                ", procDefDesc = " + procDefDesc +
                ", category = " + category +
                ", version = " + version +
                ", resource = " + resource +
                ", suspended = " + suspended +
                ", diagram = " + diagram +
                ", deployId = " + deployId +
                ", deployTime = " + deployTime +
                ", remark = " + remark +
                ", createdBy = " + createdBy +
                ", createdTime = " + createdTime +
                ", updatedBy = " + updatedBy +
                ", updatedTime = " + updatedTime +
                ", tenantId = " + tenantId +
                ", revision = " + revision +
                ", deleted = " + deleted +
                "}";
    }

    public FwProcInfoBo toBO() {
        FwProcInfoBo bo = new FwProcInfoBo();
        bo.setId(this.id);
        bo.setProcDefId(this.procDefId);
        bo.setProcDefKey(this.procDefKey);
        bo.setProcDefName(this.procDefName);
        bo.setProcDefDesc(this.procDefDesc);
        bo.setCategory(this.category);
        bo.setVersion(this.version);
        bo.setResource(this.resource);
        bo.setSuspended(this.suspended);
        bo.setDiagram(this.diagram);
        bo.setDeployId(this.deployId);
        bo.setDeployTime(this.deployTime);
        bo.setRemark(this.remark);
        bo.setCreatedBy(this.createdBy);
        bo.setCreatedTime(this.createdTime);
        bo.setUpdatedBy(this.updatedBy);
        bo.setUpdatedTime(this.updatedTime);
        bo.setTenantId(this.tenantId);
        bo.setRevision(this.revision);
        bo.setDeleted(this.deleted);
        return bo;
    }

    public FwProcInfo fromBO(FwProcInfoBo bo) {
        this.setId(bo.getId());
        this.setProcDefId(bo.getProcDefId());
        this.setProcDefKey(bo.getProcDefKey());
        this.setProcDefName(bo.getProcDefName());
        this.setProcDefDesc(bo.getProcDefDesc());
        this.setCategory(bo.getCategory());
        this.setVersion(bo.getVersion());
        this.setResource(bo.getResource());
        this.setSuspended(bo.getSuspended());
        this.setDiagram(bo.getDiagram());
        this.setDeployId(bo.getDeployId());
        this.setDeployTime(bo.getDeployTime());
        this.setRemark(bo.getRemark());
        this.setCreatedBy(bo.getCreatedBy());
        this.setCreatedTime(bo.getCreatedTime());
        this.setUpdatedBy(bo.getUpdatedBy());
        this.setUpdatedTime(bo.getUpdatedTime());
        this.setTenantId(bo.getTenantId());
        this.setRevision(bo.getRevision());
        this.setDeleted(bo.getDeleted());
        return this;
    }
}
